package com.taotao.search.listener;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;
/**
 * 【接收activeMQ队列消息的监听器】
 * @author created by wq
 * @date   Sep 2, 2017---11:50:57 PM
 * @return
 * @throws Exception<br/>
 *==========History========== <br/>
 * taotao-search-service Sep 2, 2017
 */

public class MyMessageListener implements MessageListener {

	@Override
	public void onMessage(Message message) {
		// 去消息内容
		TextMessage textMessage = (TextMessage) message;
		//取内容
		try {
			String text = textMessage.getText();
			//打印消息
			System.out.println(text);
			
		} catch (JMSException e) {
			e.printStackTrace();
		}
	}

}
